<%-- 
    Document   : verify_visit_crew
    Created on : Nov 5, 2013, 4:43:32 PM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>.: Ship Visit :.</title>    
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>   
        <script type="text/javascript">            
            $(function() {
                $("#tabs").tabs({active: $('#tabPosition').val()});
                $("#datepicker2").datepicker({
                    showOn: "button",
                    buttonImage: "${pageContext.request.contextPath}/images/icon/calendar.gif",
                    buttonImageOnly: true,
                    changeMonth: true,
                    dateFormat: 'dd/mm/yy',
                    changeYear: false,
                    maxDate: new Date(),
                    minDate: minDate()
                });
            });
            
            function minDate(){
                var year = ${actionBean.currentYear};
                var date = new Date(year,0,1);
                return date;
            }
            
            function unblockUI() {
                $.unblockUI();
            }
            
            function blockUI () {
                $.blockUI();
            }
            
            function popupWinView(id) {
                var url = '${pageContext.request.contextPath}/shipVisitFlow?viewDoc&idVisit=' + id;
                var left = (screen.width/2)-(1000/2);
                var top = (screen.height/2)-(1000/2);                
                var params = 'width=1000';
                params += ', height=1000';
                params += ', top=' + top;
                params += ', left=' + left;
                //params += ', fullscreen=yes';
                params += ', directories=no';
                params += ', location=no';
                params += ', menubar=no';
                params += ', resizable=no';
                params += ', scrollbars=yes';
                params += ', status=no';
                params += ', toolbar=no';                
                newwin = window.open(url, 'PopUp', params);
                if (window.focus) {
                    newwin.focus();
                }                
                return false;
            }
        </script>
        <style>
            .validateTips { border: 1px solid transparent; padding: 0.3em; color: red; font-weight: bold}
        </style>
    </head>
    <body>
        <s:useActionBean beanclass="exatrez.stripes.util.ListUtil" var="list"/>
        <s:useActionBean beanclass="exatrez.stripes.util.ShipVisitListUtil" var="visitlist"/>
        <s:form beanclass="exatrez.stripes.action.ShipVisitFlowAction" name="form1">
            <s:hidden name="counterId" />
            <s:hidden name="currentYear" />
            <s:hidden name="shipVisitFlowId" />
            <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">Ship Visit</span>
                    </div>
                    <s:messages/>
                    <s:errors/>
                    <table border="0" align="center" width="100%">
                        <c:if test="${actionBean.staffView}" >
                            <tr>
                                <td style="vertical-align: top; text-align: left;" colspan="7">
                                    <s:button name="" value="Back" class="btn" onclick="history.back();"/>
                                </td>
                            </tr>
                        </c:if>
                        <c:if test="${actionBean.superiorView}" >
                            <tr>
                                <td width="25%" style="vertical-align: top; text-align: right;"><b>Staff ID</b></td>
                                <td width="1%" style="vertical-align: top; text-align: left;"><b>:</b></td>
                                <td width="23%" style="vertical-align: top; text-align: left;">
                                    ${actionBean.shipVisitFlow.user.userId}&nbsp;
                                </td>
                                <td width="5%" style="vertical-align: top; text-align: left;">&nbsp;</td>
                                <td width="25%" style="vertical-align: top; text-align: right;"><b>Department</b></td>
                                <td width="1%" style="vertical-align: top; text-align: left;"><b>:</b></td>
                                <td width="23%" style="vertical-align: top; text-align: left;">
                                    ${actionBean.shipVisitFlow.user.department.departmentName}&nbsp;
                                </td>
                            </tr>
                        </c:if>
                        <tr>
                            <td width="25%" style="vertical-align: top; text-align: right;"><b>Name of Ship</b></td>
                            <td width="1%" style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td width="23%" style="vertical-align: top; text-align: left;">
                                ${actionBean.shipVisitFlow.vessel.vesselName}&nbsp;
                            </td>
                            <td width="5%" style="vertical-align: top; text-align: left;">&nbsp;</td>
                            <td width="25%" style="vertical-align: top; text-align: right;"><b>Date of Inspection</b></td>
                            <td width="1%" style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td width="23%" style="vertical-align: top; text-align: left;">
                                <fmt:formatDate value="${actionBean.shipVisitFlow.dateVisit}" pattern="dd/MM/yyyy"/>
                            </td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top; text-align: right;"><b>Place of Inspection</b></td>
                            <td style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td style="vertical-align: top; text-align: left;">
                                ${actionBean.shipVisitFlow.location}&nbsp;
                            </td>
                            <td style="vertical-align: top; text-align: left;">&nbsp;</td>
                            <td style="vertical-align: top; text-align: right;"><b>Master's Name</b></td>
                            <td style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td style="vertical-align: top; text-align: left;">
                                ${actionBean.shipVisitFlow.masterName}&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top; text-align: right;"><b>IMO Number</b></td>
                            <td style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td style="vertical-align: top; text-align: left;">
                                ${actionBean.shipVisitFlow.imoNumber}&nbsp;
                            </td>
                            <td style="vertical-align: top; text-align: left;">&nbsp;</td>
                            <td style="vertical-align: top; text-align: right;"><b>Gross Tonnage</b></td>
                            <td style="vertical-align: top; text-align: left;"><b>:</b></td>
                            <td style="vertical-align: top; text-align: left;">
                                ${actionBean.shipVisitFlow.grossTonnage}&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top; text-align: center;" colspan="7"><b>Attachment/s :</b><s:button name="" value="View" class="btn" onclick="return popupWinView('${actionBean.shipVisitFlowId}');"/></td>
                        </tr>
                    </table>
                </fieldset>
            </div>
            <div id="tabs">
                <ul >
                    <li><a href="#tabs-1" id="t1">1</a></li>
                    <li><a href="#tabs-2" id="t2">2</a></li>
                    <li><a href="#tabs-3" id="t3">3</a></li>
                    <li><a href="#tabs-4" id="t4">4</a></li>
                    <li><a href="#tabs-5" id="t5">5</a></li>
                    <li><a href="#tabs-6" id="t6">6</a></li>
                    <li><a href="#tabs-7" id="t7">7</a></li>
                    <li><a href="#tabs-8" id="t8">8</a></li>
                    <li><a href="#tabs-9" id="t9">9</a></li>
                    <li><a href="#tabs-10" id="t10">10</a></li>
                    <li><a href="#tabs-11" id="t11">11</a></li>
                    <li><a href="#tabs-12" id="t12">12</a></li>
                    <li><a href="#tabs-13" id="t13">13</a></li>
                    <li><a href="#tabs-14" id="t14">14</a></li>
                    <li><a href="#tabs-15" id="t15">${visitlist.header15}</a></li>
                </ul>
                <div id="tabs-1">
                    <div id="page-title">
                        <span class="title">${visitlist.header1}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo1}" requestURI="/shipVisitFlow" id="line1" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-2">
                    <div id="page-title">
                        <span class="title">${visitlist.header2}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo2}" requestURI="/shipVisitFlow" id="line2" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-3">
                    <div id="page-title">
                        <span class="title">${visitlist.header3}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo3}" requestURI="/shipVisitFlow" id="line3" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-4">
                    <div id="page-title">
                        <span class="title">${visitlist.header4}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo4}" requestURI="/shipVisitFlow" id="line4" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-5">
                    <div id="page-title">
                        <span class="title">${visitlist.header5}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo5}" requestURI="/shipVisitFlow" id="line5" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-6">
                    <div id="page-title">
                        <span class="title">${visitlist.header6}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo6}" requestURI="/shipVisitFlow" id="line6" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-7">
                    <div id="page-title">
                        <span class="title">${visitlist.header7}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo7}" requestURI="/shipVisitFlow" id="line7" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-8">
                    <div id="page-title">
                        <span class="title">${visitlist.header8}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo8}" requestURI="/shipVisitFlow" id="line8" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-9">
                    <div id="page-title">
                        <span class="title">${visitlist.header9}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo9}" requestURI="/shipVisitFlow" id="line9" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-10">
                    <div id="page-title">
                        <span class="title">${visitlist.header10}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo10}" requestURI="/shipVisitFlow" id="line10" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-11">
                    <div id="page-title">
                        <span class="title">${visitlist.header11}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo11}" requestURI="/shipVisitFlow" id="line11" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-12">
                    <div id="page-title">
                        <span class="title">${visitlist.header12}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo12}" requestURI="/shipVisitFlow" id="line12" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-13">
                    <div id="page-title">
                        <span class="title">${visitlist.header13}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo13}" requestURI="/shipVisitFlow" id="line13" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-14">
                    <div id="page-title">
                        <span class="title">${visitlist.header14}</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listCrewCoo14}" requestURI="/shipVisitFlow" id="line14" style="width:100%">
                        <display:column title="References" property="svDescId.svDescId" style="width:150px;"/>
                        <display:column title="Description" property="svDescId.description" style="text-align:left;"/>
                        <display:column title="Compliances" property="svCompId.description" />
                        <display:column title="Remarks" property="remarks" style="width:200px;" />
                    </display:table>
                </div>
                <div id="tabs-15">
                    <div id="page-title">
                        <span class="title">${visitlist.header15}</span>
                    </div>
                    <p>
                        <label>&nbsp;</label>
                        <s:textarea name="shipVisitFlow.summary" id="summary" rows="10" cols="70" disabled="true"/>
                    </p> 
                </div>
            </div>
            <div>
                <fieldset>
                    <c:if test="${actionBean.superiorView}" >
                        <div id="page-title">
                            <span class="title">Remarks</span>
                        </div>
                        <p>
                            <label>Approval :</label>
                            <s:radio name="status" value="A" />Approve &nbsp; <s:radio name="status" value="R" />Reject
                        </p>
                        <p>
                            <label>Comment :</label>
                            <s:textarea name="rejectNote" id="rejectnote" rows="5" cols="50"/>
                        </p>
                        <p>
                            <label>&nbsp;</label>
                            <s:submit name="staffVisitKIV" value="Back" class="btn" />&nbsp;&nbsp;&nbsp;<s:submit name="submitBack" value="Submit" class="btn" />
                        </p>
                    </c:if>
                    <c:if test="${actionBean.staffView}" >
                        <s:button name="" value="Back" class="btn" onclick="history.back();"/>
                    </c:if>
                </fieldset>
            </div>
            <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">History report</span>
                    </div>
                    <display:table class="tablecloth" name="${actionBean.listHistory}" requestURI="/shipVisitFlow" id="line" style="width:50%">
                        <display:column title="No." ><center>${line_rowNum}.</center></display:column>
                        <display:column title="Status">
                            <c:if test="${line.status eq 'R'}">
                                Rejected
                            </c:if>
                            <c:if test="${line.status eq 'A'}">
                                Approved
                            </c:if>
                        </display:column>
                        <display:column title="Remarks" property="rejectNote" />
                        <display:column title="Date Approval" sortable="true"><fmt:formatDate value="${line.infoAudit.createDate}" pattern="dd/MM/yyyy hh:mm:ss a"/></display:column>
                        <display:column title="Approval By" sortable="true" property="verifierId.userId"/>
                    </display:table>                    
                </fieldset>
            </div>
        </s:form>
    </body>
</html>
